package com.heima.article.job;

import com.heima.article.service.HotArticlesService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.log4j.Log4j2;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @作者 itcast
 * @创建日期 2020/12/23 16:26
 **/
@Component
@Slf4j
public class ComputeHotArticleJob {
    @Autowired
    private HotArticlesService hotArticlesService;
    @XxlJob("computeHotArticleJob")
    public ReturnT<String> handle(String param) throws Exception {
        log.info("热文章分值计算调度任务开始执行....");
        hotArticlesService.computeHotArticle();
        log.info("热文章分值计算调度任务开始执行....");
        return ReturnT.SUCCESS;
    }
}
